function plotData(X, y)
%PLOTDATA Plots the data points X and y into a new figure
%   PLOTDATA(x,y) plots the data points with + for the positive examples
%   and o for the negative examples. X is assumed to be a Mx2 matrix.

% Create New Figure
figure; hold on;

% ====================== YOUR CODE HERE ======================
% Instructions: Plot the positive and negative examples on a
%               2D plot, using the option 'k+' for the positive
%               examples and 'ko' for the negative examples.
%

data1 = []; %for 0
data2 = []; %for 1
for i=1:length(y),
  if y(i) == 0,
  data1 = [data1;[X(i,:)]];
  else
  data2 = [data2;[X(i,:)]];
  end;
 end;
x1 = data1(:,1);
y1 = data1(:,2);
x2 = data2(:,1);
y2 = data2(:,2);
plot(x1, y1, 'yo', 'LineWidth', 2, 'MarkerSize', 7);
plot(x2, y2, 'k+', 'LineWidth', 2, 'MarkerSize', 7);
pause;



% =========================================================================



hold off;

end
